package org.dromara.api.rank;
import org.dromara.api.rank.modules.UserRankDTO;
import org.dromara.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(contextId = "remoteRankService", value = "ruoyi-rank", fallbackFactory = RemoteRankServiceFallbackFactory.class)


//RemoteRankService作用是创建一个接口，被调用方实现
public interface RemoteRankService {

    @GetMapping("/rank/userRank/{userId}")
    R<UserRankDTO> getUserRank(@PathVariable("userId") Long userId);

    /**
     * 获取排行榜前N名（最多100）
     */
    @GetMapping("/rank/top/{count}")
    R<List<UserRankDTO>> getTopRank(@PathVariable("count") Integer count);
}
